All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface com.sun.java.swing.text.Highlighter

public interface Highlighter
An interface for an object that allows one to mark up the background with colored areas.


Method Index

 o addHighlight(int, int, Highlighter. HighlightPainter)
Adds a highlight to the view.
 o changeHighlight(Object, int, int)
Changes the given highlight to span a different portion of the document.
 o deinstall(JTextComponent)
Called when the UI is being removed from the interface of a JTextComponent.
 o getHighlights()
Fetches the current list of highlights.
 o install(JTextComponent)
Called when the UI is being installed into the interface of a JTextComponent.
 o paint(Graphics)
Renders the highlights.
 o removeAllHighlights()
Removes all highlights this highlighter is responsible for.
 o removeHighlight(Object)
Removes a highlight from the view.

Methods

 o install
 public abstract void install(JTextComponent c)
Called when the UI is being installed into the interface of a JTextComponent. This can be used to gain access to the model that is being navigated by the implementation of this interface.

Parameters:
c - the JTextComponent editor
 o deinstall
 public abstract void deinstall(JTextComponent c)
Called when the UI is being removed from the interface of a JTextComponent. This is used to unregister any listeners that were attached.

Parameters:
c - the JTextComponent editor
 o paint
 public abstract void paint(Graphics g)
Renders the highlights.

Parameters:
g - the graphics context.
 o addHighlight
 public abstract Object addHighlight(int p0,
                                     int p1,
                                     Highlighter. HighlightPainter p) throws BadLocationException
Adds a highlight to the view. Returns a tag that can be used to refer to the highlight.

Parameters:
p0 - the beginning of the range >= 0
p1 - the end of the range >= p0
p - the painter to use for the actual highlighting
Returns:
an object that refers to the highlight
Throws: BadLocationException
for an invalid range specification
 o removeHighlight
 public abstract void removeHighlight(Object tag)
Removes a highlight from the view.

Parameters:
tag - which highlight to remove
 o removeAllHighlights
 public abstract void removeAllHighlights()
Removes all highlights this highlighter is responsible for.

 o changeHighlight
 public abstract void changeHighlight(Object tag,
                                      int p0,
                                      int p1) throws BadLocationException
Changes the given highlight to span a different portion of the document. This may be more efficient than a remove/add when a selection is expanding/shrinking (such as a sweep with a mouse) by damaging only what changed.

Parameters:
tag - which highlight to change
p0 - the beginning of the range >= 0
p1 - the end of the range >= p0
Throws: BadLocationException
for an invalid range specification
 o getHighlights
 public abstract Highlighter. Highlight[] getHighlights()
Fetches the current list of highlights.

Returns:
the highlight list

All Packages  Class Hierarchy  This Package  Previous  Next  Index